import request from '@/utils/request'

// 查询合格证开具数量统计列表
export function listCertificateIssuanceStats(query) {
  return request({
    url: '/nongjt/certificateIssuanceStats/list',
    method: 'get',
    params: query
  })
}

// 导出合格证开具数量统计
export function exportCertificateIssuanceStats(query) {
  return request({
    url: '/nongjt/certificateIssuanceStats/export',
    method: 'post',
    params: query
  })
}

// 生成统计数据
export function generateStats(statsDate) {
  return request({
    url: '/nongjt/certificateIssuanceStats/generate/' + statsDate,
    method: 'post'
  })
}

// 批量生成统计数据
export function batchGenerateStats(beginDate, endDate) {
  return request({
    url: '/nongjt/certificateIssuanceStats/batchGenerate',
    method: 'post',
    params: {
      beginDate: beginDate,
      endDate: endDate
    }
  })
}

// 刷新统计数据
export function refreshStats(statsDate) {
  return request({
    url: '/nongjt/certificateIssuanceStats/refresh/' + statsDate,
    method: 'post'
  })
}
